From: Carlos Soriano Date: Mon, 14 Jul 2014 16:55:34 +0000 (+0200) Subject: viewSelector: Remove duplicate call to showPage X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2266 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5d12ab415c7cae31ec3512ea7f3c076b2c5c89d1;p=gnome-shell.git viewSelector: Remove duplicate call to showPage We were calling twice showPage() with the correct page, here and in show() / zoomFromOverview given that _resetShowAppsbutton was called from the signal 'showing' of overview. Given that the call to _resetShowAppsbutton is only actually used when hiding the overview we can actually put the checked state of the button to false when animating from overview so it shows the workspace page, causing the same behavior of _resetShowAppsbutton without all the shenanigans of resetting when the hiding overview signal is triggered. https://bugzilla.gnome.org/show_bug.cgi?id=732901 --- diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index 778bb579e..bf2d73311 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -188,7 +188,6 @@ const ViewSelector = new Lang.Class({ _init : function(searchEntry, showAppsButton) { this.actor = new Shell.Stack({ name: 'viewSelector' }); - this._showAppsBlocked = false; this._showAppsButton = showAppsButton; this._showAppsButton.connect('notify::checked', Lang.bind(this, this._onShowAppsButtonToggled)); @@ -251,13 +250,11 @@ const ViewSelector = new Lang.Class({ this._stageKeyPressId = 0; Main.overview.connect('showing', Lang.bind(this, function () { - this._resetShowAppsButton(); this._stageKeyPressId = global.stage.connect('key-press-event', Lang.bind(this, this._onStageKeyPress)); })); Main.overview.connect('hiding', Lang.bind(this, function () { - this._resetShowAppsButton(); if (this._stageKeyPressId != 0) { global.stage.disconnect(this._stageKeyPressId); this._stageKeyPressId = 0; @@ -319,6 +316,7 @@ const ViewSelector = new Lang.Class({ }, zoomFromOverview: function() { + this._showAppsButton.checked = false; this._workspacesDisplay.zoomFromOverview(); if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows()) @@ -370,7 +368,7 @@ const ViewSelector = new Lang.Class({ }); }, - _showPage: function(page, noFade) { + _showPage: function(page) { if (page == this._activePage) return; @@ -378,7 +376,7 @@ const ViewSelector = new Lang.Class({ this._activePage = page; this.emit('page-changed'); - if (oldPage && !noFade) + if (oldPage) Tweener.addTween(oldPage, { opacity: 0, time: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME, @@ -389,7 +387,7 @@ const ViewSelector = new Lang.Class({ }) }); else - this._fadePageIn(oldPage); + this._fadePageIn(); }, _a11yFocusPage: function(page) { @@ -398,21 +396,10 @@ const ViewSelector = new Lang.Class({ }, _onShowAppsButtonToggled: function() { - if (this._showAppsBlocked) - return; - this._showPage(this._showAppsButton.checked ? this._appsPage : this._workspacesPage); }, - _resetShowAppsButton: function() { - this._showAppsBlocked = true; - this._showAppsButton.checked = false; - this._showAppsBlocked = false; - - this._showPage(this._workspacesPage, true); - }, - _onStageKeyPress: function(actor, event) { // Ignore events while anything but the overview has // pushed a modal (system modals, looking glass, ...)